package com.lean.android.projecttemplate

import com.lean.android.ad.core.config.AdConfig
import com.lean.android.ad.core.config.AdParamsProvider
import com.lean.android.ad.core.config.AppInfoProvider
import com.lean.android.ad.core.config.ChannelInfoProvider
import com.lean.android.ad.core.splash.SplashAdView
import com.lean.android.channel.vasdolly.VasdollyChannelProvider
import com.lean.android.projecttemplate.ad.AdParamsProviderImpl
import com.lean.android.projecttemplate.ad.AppInfoProviderImpl
import com.lean.android.projecttemplate.ad.SplashAdViewImpl
import org.koin.dsl.module


private val adModules = module {
    single<SplashAdView> { SplashAdViewImpl() }
    single<ChannelInfoProvider> { VasdollyChannelProvider(get()) }
    single<AppInfoProvider> { AppInfoProviderImpl(get()) }
    single<AdParamsProvider> { AdParamsProviderImpl() }
    single<AdConfig> {
        AdConfig(
            appInfoProvider = get(),
            channelInfoProvider = get(),
            splashAdView = get(),
            accessPem = "${BuildConfig.APPLICATION_ID}.pem",
            adParamsProvider = get(),
            umengAppKey = "test"
        )
    }
}

val appModule = module {
    includes(adModules)
}